package com.liyunc.demo.service;

import com.liyunc.demo.model.entity.Role;
import com.liyunc.demo.model.repository.RoleRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RoleService {
    @Autowired
    private RoleRepository roleRepository;

    public void saveRole(Role role) {
        roleRepository.save(role);
    }

    public Role findRoleByName(String name) {
        return roleRepository.findRoleByName(name);
    }

    public void deleteRoleById(Long id) {
        roleRepository.deleteById(id);
    }
}
